package com.A21.GuoSai.demo.atom_adjust.jobworkers;

import com.A21.GuoSai.demo.service_entity.annotation.Author;
import com.A21.GuoSai.demo.service_entity.annotation.VariableType;
import io.camunda.zeebe.client.api.response.ActivatedJob;
import io.camunda.zeebe.client.api.worker.JobClient;
import io.camunda.zeebe.spring.client.annotation.ZeebeVariable;
import io.camunda.zeebe.spring.client.annotation.ZeebeWorker;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
@Slf4j
public class Worker03 {
    @ZeebeWorker(
            type = "c",
            name = "work03",
            forceFetchAllVariables = true
    )
    @Author(author = "FZ",attributeConnnect = "worker03")
    public void work01(final JobClient client, final ActivatedJob job,
                       @ZeebeVariable @VariableType(desc = "描述str1", isStatic = true) String str1,
                       @ZeebeVariable @VariableType(desc = "描述str2", isStatic = true) String str2,
                       @ZeebeVariable @VariableType(desc = "描述a1", isStatic = true) Integer a1){
        Map<String,Object> map=job.getVariablesAsMap();
        log.info("worker03执行完毕");
        client.newCompleteCommand(job.getKey()).send().join();
    }
}
